import common from '@ohos.app.ability.common';
import resourceManager from '@ohos.resourceManager';
import relationalStore from '@ohos.data.relationalStore';

export class globalData {
  static get filesDir() {
    return AppStorage.get<string>('filesDir');
  }

  static set filesDir(filesDir: string) {
    AppStorage.set('filesDir', filesDir);
  }

  static get aid() {
    return AppStorage.get<string>('aid');
  }

  static set aid(aid: string) {
    AppStorage.set('aid', aid);
  }

  static get cid() {
    return AppStorage.get<string>('cid');
  }

  static set cid(cid: string) {
    AppStorage.set('cid', cid);
  }

  static get intervalId() {
    return AppStorage.get<number>('intervalId');
  }

  static set intervalId(intervalId: number) {
    AppStorage.set('intervalId', intervalId);
  }

  static get abilityContext() {
    return AppStorage.get<common.UIAbilityContext>('abilityContext');
  }

  static set abilityContext(abilityContext: common.UIAbilityContext) {
    AppStorage.set('abilityContext', abilityContext);
  }

  static get resourceMana() {
    return AppStorage.get<resourceManager.ResourceManager>('resourceMana');
  }

  static set resourceMana(resourceMana: resourceManager.ResourceManager) {
    AppStorage.set('resourceMana', resourceMana);
  }

  static get rdbStore() {
    return AppStorage.get<relationalStore.RdbStore>('rdbStore');
  }

  static set rdbStore(rdbStore: relationalStore.RdbStore) {
    AppStorage.set('rdbStore', rdbStore);
  }

  static get cardRdbStore() {
    return AppStorage.get<relationalStore.RdbStore>('cardRdbStore');
  }

  static set cardRdbStore(cardRdbStore: relationalStore.RdbStore) {
    AppStorage.set('cardRdbStore', cardRdbStore);
  }

  static get notifyId() {
    return AppStorage.get<number>('notifyId');
  }

  static set notifyId(notifyId: number) {
    AppStorage.set('notifyId', notifyId);
  }

  static get biliDynamicId() {
    return AppStorage.get<number>('biliDynamicId');
  }

  static set biliDynamicId(biliDynamicId: number) {
    AppStorage.set('biliDynamicId', biliDynamicId);
  }
}